
#include <evolutive/EvolutiveCaseGeneratorBuilder.h>
#include <core/RandomCaseGen.h>
#include <iostream>
#include <vector>
#include <string.h>

using namespace std;

string dnaToStr(Dna* dna) {
	string result;

	for(int i = 0; i < 15; i++) {
		result += dna->cromossomes[i] + 0x30;
	}

	return result;
}

void printCase(Case* c) {

	cout << "Case " << c->getId() << "\n";
	cout << "Local green: " << (int) c->getLocalGreenExtension() << "\n";
	cout << "Next green: " << (int) c->getNextGreenExtension() << "\n";
	cout << "Previous green: " << (int) c->getPreviousGreenExtension() << "\n";
	cout << "Next side green: " << (int) c->getNextSideGreenExtension() << "\n";
	cout << "Previous side green: " << (int) c->getPreviousSideGreenExtension() << "\n\n";
}

int main(int argc, char** argv) {

	int populationSize = 5;

	Context context;
	EvolutiveCaseGeneratorBuilder builder(&context);
	RandomCaseGen randomGen;

	CaseGenerator* generator = builder.buildEvolutiveCaseGenerator();

	std::vector<Case*> cases;
	Case* aux;

	for(int i = 0; i < populationSize; i++) {
		aux = randomGen.generate();
		cases.push_back(aux);
	}

	generator->startEvolution(cases);

	delete generator;
//	delete context;

	return 0;
}
